<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/jsf/template.xhtml">
    	<ui:define name="content">
    	
    		<h:form id="form">
    		
    			<p:growl id="mensagem" showDetail="true" />
    			
	    		<p:panel styleClass="panelSemBorda">
	    			
	    			<!-- Opção Receita/Despesa -->
	    			<h:panelGrid columns="4" styleClass="panelSemBorda">
			    		<p:selectOneRadio id="opcaoReceitaOuDespesa" layout="custom" value="#{controleCaixaMB.controleCaixa.idReceitaDespesa}">
			    			<f:selectItem itemLabel="Receita" itemValue="1" />
			    			<f:selectItem itemLabel="Despesa" itemValue="2" />
			    		</p:selectOneRadio>

			    		<h:panelGrid columns="4">
			    			<p:radioButton id="opt1" for="opcaoReceitaOuDespesa" itemIndex="0"></p:radioButton>
			    			<h:outputLabel for="opt1" value="Receita" />
			    					
			    			<p:radioButton id="opt2" for="opcaoReceitaOuDespesa" itemIndex="1"></p:radioButton>
			    			<h:outputLabel for="opt2" value="Despesa" />
			    		</h:panelGrid>
		    		</h:panelGrid>
		    		<!-- Opção Receita/Despesa -->
		    		
		    		<h:panelGrid columns="1" cellpadding="5" >
		    		
		    			<h:outputText value="Descrição: " />
			    		<p:inputText value="#{controleCaixaMB.controleCaixa.descricao}" />
			    		
			    		<h:outputText value="Valor: " />
			    		<p:inputText value="#{controleCaixaMB.controleCaixa.valor}" >
			    			<f:convertNumber type="number" maxFractionDigits="0"/>
			    		</p:inputText>
			    		
			    		<h:outputText value="Data: " />
			    		<p:calendar value="#{controleCaixaMB.controleCaixa.data}" />
			    		
			    		<h:outputText value="Categoria: " />
			    		<p:selectOneMenu value="#{controleCaixaMB.controleCaixa.idCategoria}">  
			    			<f:selectItem itemLabel="Água" itemValue="1" />
				            <f:selectItem itemLabel="Alimentação" itemValue="2" />    
				            <f:selectItem itemLabel="Folha de Pagamento" itemValue="3" />  
				      		<f:selectItem itemLabel="Luz" itemValue="4" />  
				      		<f:selectItem itemLabel="Telefone" itemValue="5" />
				        </p:selectOneMenu> 
		    		
		    			<p:commandButton value="Salvar" actionListener="#{controleCaixaMB.add}" styleClass="ui-priority-primary" update="mensagem" />
		    		
		    		</h:panelGrid>
		    		
	    		</p:panel>
	    		
	    		
    		
    		</h:form>
    	
    	</ui:define>
    </ui:composition>
</html>